/**
 * 
 */
package de.guidoludwig.jtm.domain;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import com.jgoodies.binding.beans.Model;

/**
 * @author guido
 *
 */

@MappedSuperclass

//@AnalyzerDef(name = "standardStringAnalyzer",
//  tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
//  filters = {
//    @TokenFilterDef(factory = LowerCaseFilterFactory.class),
//    @TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = {
//      @Parameter(name = "language", value = "English")
//    })
//  })

public abstract class AbstractPersistentObject extends Model {

	@Id
	@Column(length = 40)
	// @DocumentId optional where an @Id exists
	private String oid;

	
	protected AbstractPersistentObject() {
		oid = UUID.randomUUID().toString();
	}

	public boolean equalsByOID(AbstractPersistentObject other) {
		return other != null && oid.equals(other.getOid());
	}
	public String getOid() {
		return oid;
	}

	
}
